﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using fideeraSoft.Handlers;
using System.Drawing;

namespace fideeraSoft.Paneles
{
    public class PanelGeneral : Panel
    {
        private Label lbTitulo;        
        public Handler handler;

        private TableLayoutPanel tlpTitulo;
        public TableLayoutPanel TlpTitulo
        {
            get { return tlpTitulo; }
            set { tlpTitulo = value; }
        }

        private int initialPointVertical = 25;

        private int initialRealPointVertical;

        public int InitialRealPointVertical
        {
            get { return initialRealPointVertical; }
            set { initialRealPointVertical = value; }
        }

        public void formatearPanelGeneral(Handler handler)
        {
            this.handler = handler;
            this.BackColor = Color.LightBlue;
            //this.Location = new Point(0,10);

            this.Size = handler.FormFrame.Size;
            this.Dock = DockStyle.Fill;
        }

        public void formatearPanelSegunForm(Form form)
        {   
            this.BackColor = Color.LightBlue;
            //this.Location = new Point(0,10);
            this.Size = form.Size;
            this.Dock = DockStyle.Fill;
        }


        public void formatearTableTitulo(string nameTitulo)
        {
            InitializeComponent();

            this.lbTitulo.Text = nameTitulo  ;
            //tlpTitulo.Location = new Point(MetodosGenerales.calcularCenterWidth(this.handler.FormFrame.Size.Width, tlpTitulo.Size.Width), initialPointVertical);
            tlpTitulo.Size = new Size(this.Size.Width, 60);
            tlpTitulo.Location = new Point(0, initialPointVertical);
            tlpTitulo.Controls.Add(lbTitulo);

            this.Controls.Add(tlpTitulo);

            InitialRealPointVertical = initialPointVertical + tlpTitulo.Size.Height + 30;
        }

        private void InitializeComponent()
        {
            this.lbTitulo = new System.Windows.Forms.Label();
            this.tlpTitulo = new System.Windows.Forms.TableLayoutPanel();
            this.tlpTitulo.SuspendLayout();
            this.SuspendLayout();
            // 
            // lbTitulo
            // 
            this.lbTitulo.AutoSize = true;
            this.lbTitulo.BackColor = System.Drawing.Color.Transparent;
            this.lbTitulo.Dock = System.Windows.Forms.DockStyle.Fill;
            this.lbTitulo.Font = new System.Drawing.Font("Bodoni MT", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lbTitulo.ForeColor = System.Drawing.Color.White;
            this.lbTitulo.Location = new System.Drawing.Point(3, 0);
            this.lbTitulo.Name = "lbTitulo";
            this.lbTitulo.Size = new System.Drawing.Size(394, 100);
            this.lbTitulo.TabIndex = 1;
            this.lbTitulo.Text = "";
            this.lbTitulo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // tlpTitulo
            // 
            this.tlpTitulo.BackColor = System.Drawing.Color.Navy;
            this.tlpTitulo.ColumnCount = 1;
            this.tlpTitulo.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tlpTitulo.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tlpTitulo.Controls.Add(this.lbTitulo, 0, 0);
            this.tlpTitulo.Location = new System.Drawing.Point(0, 0);
            this.tlpTitulo.Name = "tlpTitulo";
            this.tlpTitulo.RowCount = 1;
            this.tlpTitulo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tlpTitulo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tlpTitulo.Size = new System.Drawing.Size(400, 100);
            this.tlpTitulo.TabIndex = 0;
            this.tlpTitulo.ResumeLayout(false);
            this.tlpTitulo.PerformLayout();
            this.ResumeLayout(false);

        }
    }
}
